package com.gzx.plugin.tjzy.xxljob;

import com.gzx.plugin.tjzy.modular.repair.service.GzxRepairPhoneNumberService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
import vip.xiaonuo.common.tenant.TenantContext;

/**
 * @author xbl
 * 失联修复给主叫号码绑定中间号
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RepairLostXxlJob {

    private final GzxRepairPhoneNumberService repairPhoneNumberService;

    //失联修复给主叫号码绑定中间号（1分钟执行一次）
    @XxlJob("repairLostJob")
    public void repairLostJob() {
        TenantContext.ignoreHandle(() -> {
            log.info("定时任务-开始失联修复给主叫号码绑定中间号");
            repairPhoneNumberService.repairLost();
        });
    }
}
